package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the IND_PJ_PARTIC_TITU database table.
 * 
 */
@Embeddable
public class IndPjParticTituPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String oficRegId;
	private String regPubId;
	private String nuTitu;
	private String aaTitu;
	private long nsAfec;
	private long nsPersJuri;
	private String codActoRgst;
	private String sistemaId;

    public IndPjParticTituPK() {
    }

	@Column(name="OFIC_REG_ID", unique=true, nullable=false, length=2)
	public String getOficRegId() {
		return this.oficRegId;
	}
	public void setOficRegId(String oficRegId) {
		this.oficRegId = oficRegId;
	}

	@Column(name="REG_PUB_ID", unique=true, nullable=false, length=2)
	public String getRegPubId() {
		return this.regPubId;
	}
	public void setRegPubId(String regPubId) {
		this.regPubId = regPubId;
	}

	@Column(name="NU_TITU", unique=true, nullable=false, length=8)
	public String getNuTitu() {
		return this.nuTitu;
	}
	public void setNuTitu(String nuTitu) {
		this.nuTitu = nuTitu;
	}

	@Column(name="AA_TITU", unique=true, nullable=false, length=4)
	public String getAaTitu() {
		return this.aaTitu;
	}
	public void setAaTitu(String aaTitu) {
		this.aaTitu = aaTitu;
	}

	@Column(name="NS_AFEC", unique=true, nullable=false)
	public long getNsAfec() {
		return this.nsAfec;
	}
	public void setNsAfec(long nsAfec) {
		this.nsAfec = nsAfec;
	}

	@Column(name="NS_PERS_JURI", unique=true, nullable=false)
	public long getNsPersJuri() {
		return this.nsPersJuri;
	}
	public void setNsPersJuri(long nsPersJuri) {
		this.nsPersJuri = nsPersJuri;
	}

	@Column(name="COD_ACTO_RGST", unique=true, nullable=false, length=5)
	public String getCodActoRgst() {
		return this.codActoRgst;
	}
	public void setCodActoRgst(String codActoRgst) {
		this.codActoRgst = codActoRgst;
	}

	@Column(name="SISTEMA_ID", unique=true, nullable=false, length=3)
	public String getSistemaId() {
		return this.sistemaId;
	}
	public void setSistemaId(String sistemaId) {
		this.sistemaId = sistemaId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof IndPjParticTituPK)) {
			return false;
		}
		IndPjParticTituPK castOther = (IndPjParticTituPK)other;
		return 
			this.oficRegId.equals(castOther.oficRegId)
			&& this.regPubId.equals(castOther.regPubId)
			&& this.nuTitu.equals(castOther.nuTitu)
			&& this.aaTitu.equals(castOther.aaTitu)
			&& (this.nsAfec == castOther.nsAfec)
			&& (this.nsPersJuri == castOther.nsPersJuri)
			&& this.codActoRgst.equals(castOther.codActoRgst)
			&& this.sistemaId.equals(castOther.sistemaId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.oficRegId.hashCode();
		hash = hash * prime + this.regPubId.hashCode();
		hash = hash * prime + this.nuTitu.hashCode();
		hash = hash * prime + this.aaTitu.hashCode();
		hash = hash * prime + ((int) (this.nsAfec ^ (this.nsAfec >>> 32)));
		hash = hash * prime + ((int) (this.nsPersJuri ^ (this.nsPersJuri >>> 32)));
		hash = hash * prime + this.codActoRgst.hashCode();
		hash = hash * prime + this.sistemaId.hashCode();
		
		return hash;
    }
}